#ifndef SERVER_CLIENT_TOOLS
#define SERVER_CLIENT_TOOLS

#include <WinSock2.h>
#include <stdio.h>
#include "Types.h"


/*
 * Start Server
 * =========================
 * This function creates a new server and starts listening to clients trying to connect. 
 * Arguments: *Server Ip String a string containing the IP of the new server
 * 			  Server Port - an integer containing the Port number of the new server 
 * Return Value: Returns a Main Socket for the new Server
 */
SOCKET StartServer(char *ServerIpString, int ServerPort);

/*
 * Accept Connection
 * =========================
 * This function Accepts the clients that are trying to connect and creates a socket for each of them
 * Arguments: Main Socket- The server's main socket
 * Return Value: A Socket for the new connection.
 */
SOCKET AcceptConnection(SOCKET MainSocket);

/*
 * Start Client And Connect To Server
 * ==================================
 * this function creates a client and connects it to its server.  
 * Arguments: *ServerIpString-	a string containig the server IP address
 * 			  ServerPortName-	an integer containing the server's port number
 * Return Value: A connecting Socket or an INVALID_SOCKET if the function failed
 */
SOCKET StartClientAndConnectToServer(char *ServerIpString, int ServerPort);


#endif



